package com.dq.repository;

import com.dq.domain.base.BaseDao;
import com.dq.mapper.stock.StockCheckMainMapper;
import com.dq.mapper.stock.StockCheckRecordMapper;
import com.dq.repository.account.AccountRepository;
import com.dq.repository.category.CategoryRepository;
import com.dq.repository.evaluation.*;
import com.dq.repository.finance.BasePaySetRecordRepository;
import com.dq.repository.goods.BaseProductRepository;
import com.dq.repository.goods.GoodsRepository;
import com.dq.repository.goods.OrgGoodsCentreRepository;
import com.dq.repository.goods.ProductRepository;
import com.dq.repository.message.InstructionMessageRepository;
import com.dq.repository.message.InstructionStaffuserCentreRepository;
import com.dq.repository.order.*;
import com.dq.repository.org.*;
import com.dq.repository.record.*;
import com.dq.repository.service.ServiceProjectCategoryCentreRepository;
import com.dq.repository.service.ServiceProjectCategoryRepository;
import com.dq.repository.service.ServiceProjectRepository;
import com.dq.repository.set.GiftGrantSetRecordRepository;
import com.dq.repository.set.GiftGrantSetRepository;
import com.dq.repository.set.ReturnCommissionRepository;
import com.dq.repository.user.*;
import com.dq.repository.user.centre.*;
import com.dq.service.ShiroService;
import com.dq.service.goods.GoodsService;
import com.dq.service.goods.OrgGoodsCentreService;
import com.dq.service.sys.role.SysRoleService;
import com.dq.service.goods.StockChangeRecordService;
import com.dq.service.sys.user.SysUserService;
import com.dq.utils.TimeUtil;
import org.springframework.beans.factory.annotation.Autowired;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * @创建人 gewenzhen
 * @创建时间 2019/7/13
 * @描述
 */
public abstract class BaseRepositories {
    protected long mt0(String month) {
        return TimeUtil.firstTimestampOfMonth(month);
    }

    protected long mt1(String month) {
        return TimeUtil.firstTimestampOfNextMonth(month);
    }

    protected long dt0(String day) {
        return TimeUtil.firstTimestampOfDay(day);
    }

    protected long dt1(String day) {
        return TimeUtil.firstTimestampOfNextDay(day);
    }

    protected BigDecimal fmt(BigDecimal n) {
        return null != n ? n.setScale(2, RoundingMode.HALF_UP) : BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP);
    }

    protected Long fmt(Long n) {
        return null != n ? n : 0L;
    }

    protected String fmt(String n) {
        return null == n ? "" : n;
    }

    @Autowired
    protected BaseDao dao;

    @Autowired
    protected ServiceProjectCategoryCentreRepository serviceProjectCategoryCentreRepository;
    @Autowired
    protected ServiceProjectCategoryRepository serviceProjectCategoryRepository;
    @Autowired
    protected OrgPositionRepository orgPositionRepository;
    @Autowired
    protected SysMenuRepository sysMenuRepository;

    @Autowired
    protected ShiroService shiroService;
    @Autowired
    protected SysUserService sysUserService;
    @Autowired
    protected SysRoleService sysRoleService;
    @Autowired
    protected RestDayRecordRepository restDayRecordRepository;
    @Autowired
    protected ServiceRecordRepository serviceRecordRepository;
    @Autowired
    protected SubscribeRepository subscribeRepository;
    @Autowired
    protected ServiceProjectRepository serviceProjectRepository;
    @Autowired
    protected SysUserRepository sysUserRepository;

    @Autowired
    protected SysRoleRepository sysRoleRepository;

    @Autowired
    protected SysRegionRepository sysRegionRepository;

    @Autowired
    protected SysSectionRepository sysSectionRepository;

    @Autowired
    protected SysRoleSectionRepository sysRoleSectionRepository;

    @Autowired
    protected SysRoleMenuRepository sysRoleMenuRepository;

    @Autowired
    protected SysUserRoleRepository sysUserRoleRepository;

    @Autowired
    protected SysAnnexRepository sysAnnexRepository;

    @Autowired
    protected SysMacroRepository sysMacroRepository;

    @Autowired
    protected BaseMallAnnexRepository baseMallAnnexRepository;
    @Autowired
    protected WorkRoyaltySetRepository workRoyaltySetRepository;
    @Autowired
    protected RewardRepository rewardRepository;
    @Autowired
    protected BaseOrgOrderRepository baseOrgOrderRepository;
    @Autowired
    protected BaseOrderInfoRepository baseOrderInfoRepository;
    @Autowired
    protected BaseProductRepository baseProductRepository;
    @Autowired
    protected OrgGoodsCentreRepository orgGoodsCentreRepository;
    @Autowired
    protected OrderInfoRepository orderInfoRepository;
    @Autowired
    protected OrgGoodsCentreService orgGoodsCentreService;
    @Autowired
    protected StockChangeRecordRepository stockChangeRecordRepository;
    @Autowired
    protected StockChangeRecordService orgStockChangeService;
    @Autowired
    protected CategoryRepository categoryRepository;
    @Autowired
    protected GoodsRepository goodsRepository;
    @Autowired
    protected ProductRepository productRepository;
    @Autowired
    protected StaffUserRepository staffUserRepository;
    @Autowired
    protected WxUserRepository wxUserRepository;
    @Autowired
    protected OrgUserRepository orgUserRepository;
    @Autowired
    protected UserOrderStaffUserRepository userOrderStaffUserRepository;
    @Autowired
    protected BasePaySetRecordRepository basePaySetRecordRepository;
    @Autowired
    protected BossUserRepository bossUserRepository;
    @Autowired
    protected OrgRepository orgRepository;
    @Autowired
    protected GiftGrantSetRepository giftGrantSetRepository;
    @Autowired
    protected GiftGrantSetRecordRepository giftGrantSetRecordRepository;
    @Autowired
    protected OrgHonorWallRepository orgHonorWallRepository;
    @Autowired
    protected OrgTimeQuantumRepository orgTimeQuantumRepository;
    @Autowired
    protected OrgDeptPositionRepository orgDeptPositionRepository;
    @Autowired
    protected OrgCustomerLevelRepository orgCustomerLevelRepository;
    @Autowired
    protected InstructionMessageRepository instructionMessageRepository;
    @Autowired
    protected InstructionStaffuserCentreRepository instructionStaffuserCentreRepository;
    @Autowired
    protected ProfitRecordRepository profitRecordRepository;
    @Autowired
    protected ReturnCommissionRepository returnCommissionRepository;

    @Autowired
    protected OrgTemplateRepository orgTemplateRepository;
    @Autowired
    protected TrackRecordRepository trackRecordRepository;
    @Autowired
    protected EvaluationTemplateRepository evaluationTemplateRepository;
    @Autowired
    protected EvaluationTemplateChildRepository evaluationTemplateChildRepository;
    @Autowired
    protected UserLableCentreRepository userLableCentreRepository;
    @Autowired
    protected UserLableRepository userLableRepository;
    @Autowired
    protected UserPlanRepository userPlanRepository;
    @Autowired
    protected UserAnonymousRepository userAnonymousRepository;
    @Autowired
    protected GoodsService goodsService;
    @Autowired
    protected UserSummaryRepository userSummaryRepository;
    @Autowired
    protected AccountRepository accountRepository;
    @Autowired
    protected UserCardRepository userCardRepository;
    @Autowired
    protected UserCardServiceProjectCentreRepository userCardServiceProjectCentreRepository;
    @Autowired
    protected UserAccountStaffUserRepository userAccountStaffUserRepository;
    @Autowired
    protected StockCheckRecordRepository stockCheckRecordRepository;
    @Autowired
    protected StockCheckMainRepository stockCheckMainRepository;
    @Autowired
    protected StockCheckRecordMapper stockCheckRecordMapper;
    @Autowired
    protected StockCheckMainMapper stockCheckMainMapper;
    @Autowired
    protected UserSchedulingRepository userSchedulingRepository;
    @Autowired
    protected EvaluationRecordRepository evaluationRecordRepository;
    @Autowired
    protected EvaluationRecordTemplateRepository evaluationRecordTemplateRepository;
}
